package lambda;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;

public class BOS_FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new  FileOutputStream("bos.txt",true);
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        String line = "奥利给";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);

        bos.write(data);
        System.out.println("写出完毕");
        bos.flush();
        bos.close();
    }
}
